#ifndef __PRINT_H_
#define __PRINT_H_

#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>

#define BUILD_ON_LINUX

#ifdef USING_JLINK
#include "SEGGER_RTT.h"
#endif

#ifdef BUILD_ON_WINDOWS
#define filename(x) (strrchr(x, '\\') ? strrchr(x, '\\') + 1 : x)
#endif
#ifdef BUILD_ON_LINUX
#define filename(x) (strrchr(x, '/') ? strrchr(x, '/') + 1 : x)
#endif

#define my_printf(format, ...)  _my_printf(filename(__FILE__), __LINE__, format, ##__VA_ARGS__)

int _my_printf(char * pFile, uint32_t Line, char *pFormat, ...);

#endif

